import Vue from "vue";
import Router from "vue-router";
import defaultPage from "@/layout/default.vue";
import emptypage from "@/layout/empty.vue";
import goods from "@/page/goodsList.vue";
import index from "@/page/index.vue";
import changeCity from '@/page/changeCity.vue'
import Login from '@/page/login.vue'
import Register from '@/page/register.vue'
Vue.use(Router);

export default new Router({
  mode:'history',
  routes: [
    {
      path: "/",
      name: "defaultPage",
      component: defaultPage,
      children: [
        {
          path: "/goods",
          name: "goods",
          component: goods
        },
        {
          path: "/index",
          name: "index",
          component: index,
        },{
          path: "/changeCity",
          name: "changeCity",
          component: changeCity,
        }
      ]
    },
    {
      path: "/empty",
      name: "emptypage",
      component: emptypage,
      children:[{
        path: "/login",
        name: "login",
        component: Login
      },{
        path: "/register",
        name: "register",
        component: Register

      }

      ]
    }
  ]
});
